package com.hspedu.view;

import java.util.Scanner;

/**
 * 1. 显示界面
 * 2. 接受用户的输入
 * 3. 调用HouseService完成对房屋信息的各种操作
 */
public class HouseView {
    private boolean loop = true; // 控制显示菜单
    private String key = " "; // 接受用户选择

    // 显示主菜单
    public void mainMenu() {
        do {
            System.out.println("================房屋出租系统菜单===============");
            System.out.println("\t\t\t\t1 新增房源");
            System.out.println("\t\t\t\t2 查找房屋");
            System.out.println("\t\t\t\t3 删除房屋");
            System.out.println("\t\t\t\t4 修改房屋信息");
            System.out.println("\t\t\t\t5 房屋列表");
            System.out.println("\t\t\t\t6 退出");
            System.out.println("\t\t\t\t请输入你的选择(1-6):");

            key = new Scanner(System.in).next();

            switch (key) {
                case "1":
                    System.out.println("新增房源");
                    break;

                case "2":
                    System.out.println("查找房源");
                    break;

                case "3":
                    System.out.println("删除房源");
                    break;

                case "4":
                    System.out.println("修改房源");
                    break;

                case "5":
                    System.out.println("房屋列表房源");
                    break;

                case "6":
                    System.out.println("退出");
                    loop = false;
                    break;


            }
        } while (loop);

    }
}
